#include <bits/stdc++.h>

#define in read()
#define fi first
#define se second
#define pb push_back
#define y1 y_alpha_1

using namespace std;

using ll = long long;
using db = double;
using vec = vector<int>;
using pii = pair<int,int>;

int read(){
	int x = 0; bool f = 0; char ch = getchar();
	while(!isdigit(ch)) f |= ch == '-',ch = getchar();
	while(isdigit(ch)) x = (x << 1) + (x << 3) + (ch ^ 48),ch = getchar();
	return f ? -x : x;
}

const int N = 2e5+10;

int siz[N],q[N],p[N],ans[N],son[N],tsz,rt,mn,n;
vec G[N];
bool vis[N];

void froot(int x,int p){
	siz[x] = 1; son[x] = 0;
	for(auto y : G[x])
		if(y != p && !vis[y])
			froot(y,x),siz[x] += siz[y],son[x] = max(son[x],siz[y]);
	son[x] = max(tsz - siz[x],son[x]); if(son[x] < mn) rt = x,mn = son[x];
}

void dfs(int x,int pp,int d){
	siz[x] = 1; for(auto y : G[x]) if(y != pp && !vis[y]) dfs(y,x,d + 1),siz[x] += siz[y];
	p[siz[x]] = max(p[siz[x]],d);
}

void Divide(int x,int bsz){
	tsz = mn = bsz; rt = 0; froot(x,0); x = rt; vis[x] = 1; int lz = 0;
	for(auto y : G[x])
		if(!vis[y]){
			dfs(y,0,1); lz = max(lz,siz[y]);
			for(int i = siz[y] - 1;i;i--) p[i] = max(p[i],p[i + 1]);
			for(int i = 1;i <= siz[y];i++) ans[i * 2] = max(ans[i * 2],p[i] + q[i]);
			for(int i = 1;i <= siz[y];i++) q[i] = max(q[i],p[i]),p[i] = 0;
		}
	for(int i = 1;i <= lz;i++) q[i] = 0; for(auto y : G[x]) if(!vis[y]) Divide(y,siz[y]);
}

int main(){
#ifndef ONLINE_JUDGE
	freopen("1.in","r",stdin);
#endif
	n = in; for(int i = 1,u,v;i < n;i++) u = in,v = in,G[u].pb(v),G[v].pb(u);
	Divide(1,n); for(int i = 1;i <= n;i++) printf("%d\n",ans[i] + 1);
	return 0;
}
